SAS Macro Version Control
نویسنده
چکیده
During the development and maintenance (life-cycle) process of SAS® macros, especially while they are already used for production purposes, it is very much recommended to keep a history of changes, additions and bug fixes along with the macro version number. Archiving of the production SAS program code should include the applied macro version or at least the applied macro version number. That way the code can be used for reproduction purposes. Newer versions of a macro should be as much as possible backwards compatible. Then a newer version may replace an older version when running reproduction SAS programs. In case a current macro version is not fully backwards compatible it should not be used for reproduction purposes with code that used to call the older macro version. Instead the older macro version has to be used. A version control system within the macro code is presented which allows the user to specify which (compatible) version of a particular macro is to be used. If the current macro version is known not to be compatible with an older, specified version it refuses to run, generates an appropriate message and stops. The user then should take care for replacing it by the appropriate older macro version. Alternative solutions that don’t stop the code from running and that allow forcing of a specific version of a macro to run, are being presented. INTRODUCTION CHANGE CONTROL During the development and maintenance (life-cycle) process of SAS macros, especially while they are already used for production purposes, it is very much recommended to keep a history of changes, additions and bug fixes along with the macro version number. Archiving of the production SAS program code should include the applied macro version or at least the applied macro version number. That way the original SAS and macro code can be used for reproduction purposes. They may already have been validated in combination, just like other versions. This is the regulatory aspect of version control. BACKWARD INCOMPATIBILITIES Newer versions of a macro should be as much as possible backwards compatible. Then a newer version may replace an older version when running reproduction SAS programs. There are, however, instances where a newer macro may not be fully backwards compatible. Examples of such instances are: changed or removed parameter names; changed default argument values; changed or removed argument values with specific meanings; changed functional actions of existing argument values. VERSION CONTROL In case a current macro version is not fully backwards compatible it should not be used for reproduction purposes with SAS code that used to call the older macro version. Instead the older macro version has to be used. A version control system within the macro code is presented which allows the user to specify which (compatible) version of a particular macro is to be used. If the current macro version is known not to be compatible with an older, specified version it refuses to run, generates an appropriate message and stops. The user then should take care for replacing it by the appropriate older macro version. Alternative solutions, that don’t stop the code from running and that allow forcing of a specific version of a macro to run, are being presented. STOPPING VERSION The version control system consists of an additional parameter Version in the macro call and of macro code interpreting the Version value. It has a default value of the current version number, allowing running it normally. If the user explicitly specifies an older, backwards incompatible version number it will not perform its normal action, but notify the user to use the older version. Possibly incompatible or at least different results are thus being avoided. If the user specifies another, but backwards compatible version number, the newest macro allows running itself. The code that interprets the version number is: %IF (&Version NE AND &Version NE &MacroVs) %THEN /* if Version not default and not empty */ %DO; %PUT *** &MacName *** &ERR: Specified version &Version does not match &MacroVs,; %PUT . macro &MacName will abort; %LET ErrCount = %EVAL ( &ErrCount + 1); %GOTO Finish; %END; SAS Global Forum 2007 Coders’ Corner
منابع مشابه
191-2007: Model Selection in PROC MIXED—A User-Friendly SAS® Macro Application
A user-friendly SAS macro application to perform all possible model selection of fixed effects including quadratic and cross products within a user-specified subset range in the presence of random and repeated measures effects using SAS PROC MIXED is available. This macro application, ALLMIXED2 will complement the model selection option currently available in the SAS PROC REG for multiple linea...
متن کاملPerformance Issues to Consider When Migrating Production Jobs from Version 5 to Version 6 of the SAS® System under MVS
This paper deals with performance issues when migrating production jobs from Version 5 to Version 6 of the SAS® System under MVS. Due to the significant differences between the architectures of Version 6 and Version 5 of the SAS System, the user might experience performance degradation/improvement when migrating some jobs to Version 6 of the SAS System. Specific areas to consider are formats an...
متن کاملDETERMINING and PROFILING MVS SYSTEM ACTIVITY with MXG @ and SAS
T~i~ pa.per .describes a program written in the SAS system which determines and profiles daily resource ubhz~t:on In terms of .hourly service unit consumption in an MVS environment. The program utilizes Mernll s Expanded GUlde (MXG) software as a frontend along with base SAS software, the SAS macro language, and SASIGRAPH@ software. Subsequently, each MVS installation is provided with a high-le...
متن کاملComputing Counts for CONSORT Diagrams: Three Alternatives
It is standard practice to document how the sample used for a study was determined – first showing all subjects considered and then the numbers of same that were successively removed from the cohort for various reasons. SAS® does not provide a specific facility for generating the tables/diagrams commonly used to present cohort determination information. Recently, Art Carpenter and Dennis Fisher...
متن کامل1 Weighted Sequential Hot Deck Imputation : SAS Macro vs . SUDAAN ’ s PROC
Item non-response is a challenge faced by virtually all surveys. Item non-response occurs when a respondent skips over a question, refuses to answer a question, or indicates that they do not know the answer to a question. Hot deck imputation is one of the primary item non-response imputation tools used by survey statisticians. Recently, new competitor in the field of Weighted Sequential Hotdeck...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007